<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.*" %>
<%@ page language="java" import="com.app.utils.*" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";


 
%>
<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>-</title>


    <link type="text/css" href="<%=basePath%>static/sub/assets/css/vendor-morris.css" rel="stylesheet">
    <link type="text/css" href="<%=basePath%>static/sub/assets/css/vendor-bootstrap-datepicker.css" rel="stylesheet">

    <!-- Prevent the demo from appearing in search engines -->
    <meta name="robots" content="noindex">

    <!-- App CSS -->
    <link type="text/css" href="<%=basePath%>static/sub/assets/css/app.css" rel="stylesheet">
    <link type="text/css" href="<%=basePath%>static/sub/assets/css/app.rtl.css" rel="stylesheet">

    <!-- Simplebar -->
    <link type="text/css" href="<%=basePath%>static/sub/assets/vendor/simplebar.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/2.1.4/jquery.js"></script>
<link rel="stylesheet"
	href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
<script src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>

<link rel="stylesheet" href="<%=basePath%>static/animate.css">
<script src="<%=basePath%>static/js.js" charset="utf-8"></script>
<style>
body {
	overflow-x: hidden
}

body::-webkit-scrollbar { /*滚动条整体样式*/
	width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
	height: 1px;
}

body::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
	border-radius: 10px;
	-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
	background: #EEE;
}

body::-webkit-scrollbar-track { /*滚动条里面轨道*/
	-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
	border-radius: 10px;
	background: #DDD;
}

.dataTables_filter input {
	border: 1px solid #ddd;
}
</style>
<script>
	$(document).ready(function() {
		$('table').DataTable({
			language : {
				"sProcessing" : "处理中...",
				"sLengthMenu" : "显示 _MENU_ 项结果",
				"sZeroRecords" : "没有匹配结果",
				"sInfo" : "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
				"sInfoEmpty" : "显示第 0 至 0 项结果，共 0 项",
				"sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
				"sInfoPostFix" : "",
				"sSearch" : "搜索:",
				"sUrl" : "",
				"sEmptyTable" : "表中数据为空",
				"sLoadingRecords" : "载入中...",
				"sInfoThousands" : ",",
				"oPaginate" : {
					"sFirst" : "首页",
					"sPrevious" : "上页",
					"sNext" : "下页",
					"sLast" : "末页"
				},
				"oAria" : {
					"sSortAscending" : ": 以升序排列此列",
					"sSortDescending" : ": 以降序排列此列"
				}
			}
		});

	});
</script>
  <!-- titel -->
  <title></title>
  <style>
  .form{margin-bottom:15px;}
  .form p{color:#333!important;margin-bottom:0px;}
  </style>
</head>
<body>

 
              <div class="admin-content am-u-lg-6 am-cf am-padding am-padding-bottom-0" style="padding:15px;">
                <!-- big box -->
                <div class="big-box">
                  <div class="col-lg-12">
                    
                    <form method="POST"  action="<%=basePath%>users/users/update">
                    <div class="card">
                      <div class="card-head">
                        <div class="left">
                        <h4>资料更新</h4>
                        </div>
                        <div class="right"> <p class="am-text-danger">
                        ${message }</p>
                          <i class="zmdi zmdi-chevron-down"></i>
                          <i class="zmdi zmdi-refresh-sync"></i>
                          <i class="zmdi zmdi-close-circle-o"></i>
                        </div>
                      </div>
                      <div class="card-body">
                          <div class="row">
                        <div class="form col-md-6">
                          <p>员工名</p>                          
                          <input name="username" class="form-control" readonly value="${user.username }" type="text" placeholder="" >
        <input name="id" type="hidden" value="${user.id }">
                        </div>
                        <div class="form-group col-md-4">
                                    <label for="user-name" class="am-u-sm-2 am-form-label">部门</label>
                                    <div class="am-u-sm-8">
                                     <select name="company">
                                        <c:forEach items="${requestScope.list }" var="u" varStatus="st">
                                        <option value="${u.id }">
                                        ${u.title }
                                        </option>
                                        </c:forEach>
                                        </select>
                                        <small></small>
                                    </div>
                                </div>
                                  <c:if test="${usertype ne 5 }">
                                      <input name="money" type="hidden" value="${user.money }">
                                  </c:if>
                                <c:if test="${usertype eq 5 }">
                                <div class="am-form-group col-md-4">
                                    <label for="user-name" class="am-u-sm-2 am-form-label">工资</label>
                                    <div class="am-u-sm-8">
                                        <input type="number" class="form-control"  value="${user.money }" name="money" required placeholder="">
                                        <small></small>
                                    </div>
                                </div>
                                </c:if>
                          </div>

                              <div class="row">
                              
                              
                             <div class="form col-md-12">
                          <p style="">头像
                           <c:if test="${!empty user.thumb}">
		<img class="uploadImg oldImg" style="width:150px;height:150px;display:block;" src="<%=basePath %>${user.thumb}"/>
		
</c:if>
	
		<input type="text"   id="thumb" value="${user.thumb}" name="thumb" >
		<a href="javascript:;" class="uploadImg am-btn am-btn-success">上传图片</a></p>    
                        </div>
                          </div>


                          <div class="row">
                           <div class="form col-md-4">
                          <p>姓名</p>                          
                           <input name="realname" class="form-control" type="text" value="${user.realname }">
                        </div>
                        
                         <div class="form col-md-4">
                          <p>性别</p>
                             <select class="form-control" name="sex" id="">
                                 <option <c:if test="${user.sex==1}"> selected </c:if> value="1" >男</option>
                                 <option <c:if test="${user.sex==2}"> selected </c:if> value="2" >女</option>
                             </select>

                        </div>
                        
                         <div class="form col-md-4">
                          <p>年龄</p>                          
                           <input name="age" required class="form-control" type="text" value="${user.age }">
                        </div>
                          </div>
                          <div class="row">
                         <div class="form col-md-6">
                          <p>身份证</p>                          
                           <input name="ecard" class="form-control" type="text" value="${user.ecard }">
                        </div>
                         <div class="form col-md-6">
                          <p>地址</p>                          
                           <input name="address" class="form-control" type="text" value="${user.address }">
                        </div>
                          </div>
                              <div class="row">
                        
                        <div class="form col-md-6">
                          <p>邮箱</p>                          
                            <input name="email" class="form-control" type="text" value="${user.email }">
                        </div>
                        
                        <div class="form col-md-6">
                          <p>QQ</p>                          
                            	<input name="qq" class="form-control" type="text" value="${user.qq }">
                        </div>
                        
                        <div class="form col-md-6">
                          <p>电话</p>                          
                          <input name="tel" class="form-control" type="text" value="${user.tel }">
                        </div>
                              </div>
                          
                          
                          <c:if test="${user.type eq 3 }">
                           <div class="row">
                          <div class="form col-md-12">
                          <p>教育履历，技术专长，工作履历</p> 
                            <textarea name="position" required>${user.position }</textarea>
                             </div>
                          </div>
                          </c:if> <c:if test="${user.type ne 3 }">
                          <div class="row">
                          <div class="form col-md-12">
                          <p>个人说明</p>                          
                          <input name="position" class="form-control" type="text" value="${user.position }">
                        </div>
                          </div>
                          
                          </c:if>
                          
                          
                          
                           <div class="form col-md-6">
                          <p></p>
                               <div class="row">
                          <button class="am-btn am-btn-primary" type="submit">提交</button>
                               </div>
                        </div>
                        <div class="form col-md-6">
                        <h1 style="height:50px;"></h1>
                        </div>
                      </div>
                    </div>
                    
                    </form>
                    
                    
                  </div>
                    
                </div>
              </div>
            </div>
        
  <!-- end Layout -->


  <!-- script -->
  <script src="<%=basePath %>static/admin/js/jquery.min.js"></script>
  
  
  <script src="<%=basePath%>source/scripts/window.js"></script>
  <script>
$().ready(function(){
	$(".uploadImg").click(function(){
		openWindow("<%=basePath%>upload.jsp");
	});
	$("#thumb").on("input",function(){
		$(".oldImg").attr("src","<%=basePath%>"+$("#thumb").val());
	});
});
</script>


              <c:if test="${!empty message}">
                  <script>
                      var btn = $("#showMsgBtn", window.parent.document);
                      var msg = $("#msg", window.parent.document);
                      $(msg).val("${message}");
                      $(btn).click();
                      //layer.alert("${message}",{icon: 1});
                  </script>
              </c:if>


</body>
</html>

